package com.macro.mall.demo2.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.demo2.dto.PmsPortalProductDetail;
import com.macro.mall.demo2.service.PmsProtalProductDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：贾维斯
 * @Description: 描述
 * @name：PmsPortalProductDetailController
 * @Date：2024/10/20 16:59
 */
@RestController
@RequestMapping("/product")
public class PmsPortalProductDetailController4 {
    @Autowired
    private PmsProtalProductDetailService pmsProtalProductDetailService;

    /**
     * 获取商品的详细信息
     * @param id
     * @return
     */
    @GetMapping("/detail/{id}")
    public CommonResult<PmsPortalProductDetail> pmsProtalList(@PathVariable Long id) {
        PmsPortalProductDetail pmsPortalProductDetail = pmsProtalProductDetailService.selectById(id);
        return CommonResult.success(pmsPortalProductDetail);
    }
}
